﻿//  Copyright (c) 2011 Ray Liang (http://www.dotnetage.com)
//  Licensed MIT: http://www.opensource.org/licenses/mit-license.php

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using DNA.Mvc.jQuery;
using DNA.Mvc.Community.Controllers;

namespace DNA.Mvc.Community
{
    public static class ForumUIExtensions
    {
        public static MvcHtmlString ForumMapPath(this AjaxHelper helper, int forumID)
        {
            var dbContext = DependencyResolver.Current.GetService<IForumContext>();
            var provider = new ForumHierarchicalNodeProvider(dbContext.Forums);
            return helper.Crumb(provider as IHierarchicalNodeProvider, forumID.ToString());
        }
    }
}
